This invention relates to a method and a device for controlling a motor, in which a driving velocity of a driven target driven by the motor is calculated based on an edge cycle of a pulse signal, so that the motor is driven and controlled at a target velocity which corresponds to the driving velocity.
Heretofore, an image forming apparatus such as an ink jet printer is provided with a carriage mounting a recording head thereon. The carriage is disposed capable of being moved to and fro along a guide shaft, and driven (moved) by a motor.
In this type of the image forming apparatus, it is necessary to move the recording head (and the carriage) at a constant velocity at the time of forming an image on a recording sheet. Therefore, the motor, driving the carriage, is accelerated per one scan of the carriage so that the moving velocity of the carriage goes up to a constant target velocity at a recording start position where recording operation by the recording head is started. When the carriage reaches the recording start position, the carriage is moved at the constant target velocity until a recording termination position where the recoding operation by the recording head is ended. When the carriage reaches the recording termination position, the carriage is decelerated to be stopped at a target stop position.
Also, this type of the image forming apparatus is known to include a reflective optical sensor in the carriage at a position facing the recording sheet. While the carriage is moved at an extremely low velocity, the change in level is detected of light receiving signals from the reflective optical sensor, so that the positions of both ends of the recording paper are optically detected which are arranged to face the recording head.
In the case of controlling a motor as above, every time the carriage as a driven target is moved for a specified distance (or every time a rotation shaft of the motor is rotated by a specified angle), an encoder operates and generates pulse signals. The motor is feedback controlled so that the moving velocity of the carriage (i.e., the driving velocity of the driven target), calculated discretely based on the pulse signals outputted from the encoder, corresponds to a specified target velocity.
However, in the case of feedback controlling the motor as such, when the motor is driven at a low velocity, e.g., at the time of detecting the positions of both ends of the recording paper, rotation of the motor is temporarily stopped due to fluctuation, etc., of the load applied to the motor. Sometimes the motor is never recovered from the stopped state.
In other words, in the feedback control of the motor as above, the driving velocity of the driven target is updated per edge timing of the pulse signal outputted from the encoder. Therefore, if a manipulated variable of the motor is set to be calculated per predetermined constant cycle, the actual velocity of the driven target is sometimes updated or sometimes not updated by the pulse edge, at the time of calculating the manipulated variable.
On the other hand, when the driven target is driven at a low velocity, the driving velocity of the driven target is substantially reduced. The friction caused in the driving system is changed from dynamic to static so that the load applied to the motor is increased. Also in this case, the motor itself cannot obtain stability from a hack electromotive force if a certain level of rotation velocity is not produced. Thus, the motor is susceptible to the effect of the load. In addition, the load applied to the motor is fluctuated by uncertain factors such as conditions of grease applied and minute foreign bodies (e.g., dust) stuck to a sliding portion of the driven target.
Therefore, the driven target is sometimes stopped temporarily when driven at a low velocity. As shown in FIG. 20A, if the velocity (detection velocity) of the driven target, which is updated per edge timing of the encoder, is higher than the target velocity, a manipulated variable is calculated, which decelerates the velocity of the motor, at the calculation timing (controlled calculation timing) of the manipulated variable. As a result, the motor is completely stopped and this eventually leads to a mechanical error of the driving system.
FIG. 20A is a time chart showing a relationship among the actual velocity of the driven target, the detection velocity obtained based on the encoder edge cycle, and the target velocity, when a motor control device is constituted such that the calculation timing (controlled calculation timing) of a manipulated variable occurs per constant cycle. Even when the controlled calculation timing is set to correspond with the encoder edge timing, the same problem occurs.
In this case, as the driven target is stopped, the calculation of the manipulated variable is also stopped. Thus, similar to the case in which the controlled calculation timing is set at a constant cycle, the stopped state of the driven target continues until a mechanical error of the driving system is found.
The problem like the above also occurs at the time of accelerating the motor.
For example, the carriage as the driven target is assumed to be accelerated from the stopped state to a target velocity. As shown in FIG. 20B, immediately after the driven target is started to be driven, so-called open loop control (O/P) is performed in which the manipulated variable of the motor is sequentially set in synchronization with the encoder edge timing so that the driven target is accelerated along a velocity locus predetermined in accordance with the characteristics of the driving system. Then, after the driven target is accelerated to some extent, the motor control is switched to the aforementioned feedback control (F/B).
However, the manipulated variable set at the time of open loop control (O/P) is in accordance with the idealistic characteristics of the driving system of the driven target. Therefore, when the manipulated variable is used to actually control the motor, the driving velocity of the driven target becomes sometimes high and sometimes low, due to variation, etc. of the characteristics of the driving system.
As shown in FIG. 20B, when the driving velocity of the driven target becomes higher than the expected velocity locus, the control is switched from the open loop control (O/P) to the feedback control (F/B). The manipulated variable of the motor is calculated to decelerate the driven target, resulting in that the motor (and the driven target) may be stopped.
Once the driven target is stopped as such, no pulse edge is inputted from the encoder. Similar to the case at the time of driving the motor at a low velocity, the stopped state continues and a mechanical error of the driving system is eventually found.
It would be desirable that the drive of the motor can be resumed, even if the motor is temporarily stopped at the low velocity driving and at the accelerated driving of the motor, which is feedback controlled based on the pulse outputted from the encoder.